import 'package:json_annotation/json_annotation.dart';

//定义生成的文件 flutter pub run build_runner build --delete-conflicting-outputs
part 'bean_test_json.g.dart';

@JsonSerializable(explicitToJson: true)
class TestUser {
  String? name;
  String? email;
  TestUser({this.name, this.email});

  //添加固定格式
  factory TestUser.fromJson(Map<String, dynamic> json) => _$TestUserFromJson(json);
  Map<String, dynamic> toJson() => _$TestUserToJson(this);
}
